from django.conf.urls import url
from rest_framework.routers import DefaultRouter

from areas import views
from areas.views import AreaViewSet

urlpatterns = [

    # url(r'^areas/$', views.AreasView.as_view()),
    # url(r'^areas/(?P<pk>\d+)/$', views.SubsView.as_view())
]

# 创建router对象
router = DefaultRouter()
# 　注册router对象,参数,url的统一前缀,指定视图集,url名字的统一前缀
router.register('areas', AreaViewSet, basename='areas')
# 将生成的url添加到列表中
urlpatterns += router.urls
